<template>
  <div class="home">
    <el-table
      :data="tableData"
      style="width: 100%; margin-bottom: 20px"
      row-key="id"
      border
      :tree-props="{ children: 'children', hasChildren: 'hasChildren' }"
    >
      <el-table-column prop="name" label="区域名称"> </el-table-column>
      <el-table-column prop="type" label="区域类型">
        <template slot-scope="scope">
          <span v-if="scope.row.type == 1">省</span>
          <span v-else-if="scope.row.type == 2">市</span>
          <span v-else-if="scope.row.type == 3">区</span>
        </template>
      </el-table-column>
      <el-table-column prop="code" label="区域编码"> </el-table-column>
    </el-table>
  </div>
</template>

<script>
import { xzqybl } from "@/api/shangchangguanli/xzqy.js";
export default {
  data() {
    return {
      tableData: [],
    };
  },
  mounted() {
    xzqybl().then((res) => {
      this.tableData = res.data.list;
    });
  },
};
</script>

<style lang="scss" scoped>
.home::v-deep {
  padding: 20px;
  font-size: 12px !important;
}

</style>